package com.dongdongshop.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.TbContentCategoryMapper;
import com.dongdongshop.pojo.seller.TbContentCategory;
import com.dongdongshop.service.ContentCategoryService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
@Service
public class ContentCategoryServiceImpl implements ContentCategoryService {
    @Resource
    private TbContentCategoryMapper tbContentCategoryMapper;

    @Override
    public int deleteById(Long[] ids) {
        return tbContentCategoryMapper.deleteById(ids);
    }

    @Override
    public int update(TbContentCategory tbContentCategory) {
        return tbContentCategoryMapper.updateByPrimaryKeySelective(tbContentCategory);
    }

    @Override
    public TbContentCategory seleteById(Long id) {
        return tbContentCategoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public int addCategory(TbContentCategory contentCategory) {
        return tbContentCategoryMapper.insertSelective(contentCategory);
    }

    @Override
    public List<TbContentCategory> getName(String name) {
        return tbContentCategoryMapper.getName(name);
    }

    @Override
    public List<TbContentCategory> getInfo() {
        return tbContentCategoryMapper.selectByExample(null);
    }
}
